import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
=new Scanner
(System.
in); long n,k;
n=in.nextLong();
k=in.nextLong();
long findMax;
if(n>0&& k>=0)
{
for(int iter=0;iter<n;iter++)
{
arr[iter]=in.nextLong();
}
if(k%2==1)
{k=1;}
else
{k=2;}
while(k-->0)
{
for(int iter=0;iter<n;iter++)
{
arr[iter]=findMax-arr[iter];
}
}
}
for(int iter=0;iter<n;iter++)
{
System.
out.
print(arr
[iter
]+" "); }
}
}
CmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgaW49bmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlsb25nICBuLGs7CgoJCW49aW4ubmV4dExvbmcoKTsKCQlrPWluLm5leHRMb25nKCk7CgoJCUxvbmcgYXJyW109bmV3IExvbmdbKGludCluXTsKCgkJbG9uZyBmaW5kTWF4OyAgICAgIAoJCWlmKG4+MCYmIGs+PTApCgkJewoJCQlmb3IoaW50IGl0ZXI9MDtpdGVyPG47aXRlcisrKQoJCQl7CgkJCQlhcnJbaXRlcl09aW4ubmV4dExvbmcoKTsKCgkJCX0KCgkJCgkJCWlmKGslMj09MSkKCQkJe2s9MTt9CgkJCWVsc2UKCQkJe2s9Mjt9CgoJCQl3aGlsZShrLS0+MCkKCQkJewoJCQkJTGlzdCA8TG9uZz4gbGlzdD0gQXJyYXlzLmFzTGlzdChhcnIpOwoJCQkJZmluZE1heD0obG9uZylDb2xsZWN0aW9ucy5tYXgobGlzdCk7CgoJCQkJZm9yKGludCBpdGVyPTA7aXRlcjxuO2l0ZXIrKykKCQkJCXsKCQkJCQlhcnJbaXRlcl09ZmluZE1heC1hcnJbaXRlcl07CgoJCQkJfSAgICAKCgkJCX0KCQl9CgkJZm9yKGludCBpdGVyPTA7aXRlcjxuO2l0ZXIrKykKCQl7IAoJCQlTeXN0ZW0ub3V0LnByaW50KGFycltpdGVyXSsiICAiKTsKCQl9ICAKCgl9Cn0=