class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: G = None
        self.s: F = None
        self.u: G = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: F = None
        self.p: C = None
        self.s: F = None
        self.u: C = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.w: D = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.x: G = None
        self.q: E = None
        self.w: A = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

k = A("k")
a = B("a")
b = C("b")
n = D("n")
j = E("j")
f = F("f")
g = G("g")
e = D("e")
d = E("d")
m = C("m")

k.q = b
k.y = g
k.u = g
k.s = f
k.p = f
k.t = e
a.z = g
a.v = f
a.s = f
a.p = b
a.u = m
a.t = m
a.x = d
b.z = g
b.o = d
n.q = k
n.u = e
n.w = e
n.z = e
n.o = g
j.t = f
j.p = f
j.o = f
j.x = g
j.q = d
j.w = k
j.z = n
f.w = m
g.z = d
g.o = d
g.r = n
e.q = k
e.u = n
e.w = n
e.z = n
e.o = g
d.t = f
d.p = f
d.o = f
d.x = g
d.q = j
d.w = k
d.z = n
m.z = g
m.o = d
assert g.r.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: G = None
        self.s: F = None
        self.u: G = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: F = None
        self.p: C = None
        self.s: F = None
        self.u: C = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.w: D = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: F = None
        self.x: G = None
        self.q: E = None
        self.w: A = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.o: E = None
        self.txt = txt

k = A("k")
a = B("a")
b = C("b")
n = D("n")
j = E("j")
f = F("f")
g = G("g")
e = D("e")
d = E("d")
m = C("m")

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