public static long[] extendedEuler(long a, long b) {
//		if (b > a) {
//			// in this case, we swap the order of a and b
//			// make sure to also swap the result
//			long[] result = extendedEuler(b, a);
//			long temp = result[0];
//			result[0] = result[1];
//			result[1] = temp;
//			return result;
//		}

		// base case
		if (a == 0) {
			return new long[] { 0, 1, b };
		}

		long[] result = extendedEuler(b % a, a);
		long x = result[0];
		long y = result[1];
		long z = result[2];
		return new long[] { y - (b / a) * x, x, z };
	}