class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: B = None
        self.t: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.r: F = None
        self.y: D = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
a = C("a")
m = D("m")
i = E("i")
e = F("e")
j = G("j")
d = G("d")
f = D("f")

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.r: F = None
        self.y: D = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
a = C("a")
m = D("m")
i = E("i")
e = F("e")
j = G("j")
d = G("d")
f = D("f")

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