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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

m = A("m")
i = B("i")
c = C("c")
l = D("l")
b = E("b")
e = F("e")
k = G("k")
n = A("n")
d = D("d")
a = D("a")

m.r = b
m.z = c
m.t = n
m.s = a
i.w = l
c.w = d
c.x = e
c.t = b
c.z = b
c.q = n
c.s = k
c.v = a
l.o = b
l.x = c
l.y = e
l.u = i
b.v = c
e.r = k
k.t = i
k.u = i
k.z = m
k.w = c
n.r = b
n.z = c
n.t = m
n.s = d
d.o = b
d.x = c
d.y = e
d.u = i
a.o = b
a.x = c
a.y = e
a.u = i
assert n.r.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: C = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.u: B = None
        self.w: C = None
        self.txt = txt

m = A("m")
i = B("i")
c = C("c")
l = D("l")
b = E("b")
e = F("e")
k = G("k")
n = A("n")
d = D("d")
a = D("a")

m.r = b
m.z = c
m.t = n
m.s = a
i.w = l
c.w = d
c.x = e
c.t = b
c.z = b
c.q = n
c.s = k
c.v = a
l.o = b
l.x = c
l.y = e
l.u = i
b.v = c
e.r = k
k.t = i
k.u = i
k.z = m
k.w = c
n.r = b
n.z = c
n.t = m
n.s = d
d.o = b
d.x = c
d.y = e
d.u = i
a.o = b
a.x = c
a.y = e
a.u = i
assert n.r.v.v.u.txt == "i"