class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.y: H = None
        self.q: C = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: J = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.p: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: I = None
        self.w: I = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.o: I = None
        self.y: B = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.o: E = None
        self.y: B = None
        self.s: G = None
        self.z: B = None
        self.r: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

c = A("c")
k = B("k")
h = C("h")
j = D("j")
n = E("n")
m = F("m")
f = G("f")
a = H("a")
i = I("i")
d = J("d")

c.z = m
c.y = n
k.p = m
k.r = n
k.y = a
k.q = h
k.s = f
h.s = n
h.z = d
h.x = m
h.r = i
j.q = d
n.z = m
n.x = c
n.p = d
m.z = a
m.o = a
f.y = c
f.q = i
f.w = i
f.t = n
a.x = c
a.q = h
a.r = h
a.o = i
a.y = k
a.w = f
i.u = h
i.t = n
i.o = n
i.y = k
i.z = k
i.s = f
i.r = j
i.p = a
d.z = j
d.v = n
d.u = c
assert i.r.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: E = None
        self.y: H = None
        self.q: C = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: J = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.p: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: I = None
        self.w: I = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.o: I = None
        self.y: B = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.o: E = None
        self.y: B = None
        self.s: G = None
        self.z: B = None
        self.r: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

c = A("c")
k = B("k")
h = C("h")
j = D("j")
n = E("n")
m = F("m")
f = G("f")
a = H("a")
i = I("i")
d = J("d")

c.z = m
c.y = n
k.p = m
k.r = n
k.y = a
k.q = h
k.s = f
h.s = n
h.z = d
h.x = m
h.r = i
j.q = d
n.z = m
n.x = c
n.p = d
m.z = a
m.o = a
f.y = c
f.q = i
f.w = i
f.t = n
a.x = c
a.q = h
a.r = h
a.o = i
a.y = k
a.w = f
i.u = h
i.t = n
i.o = n
i.y = k
i.z = k
i.s = f
i.r = j
i.p = a
d.z = j
d.v = n
d.u = c
assert i.r.q.u.txt == "c"