class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: D = None
        self.t: B = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.t: E = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: C = None
        self.o: F = None
        self.q: C = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.t: E = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: C = None
        self.o: F = None
        self.q: C = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: E = None
        self.txt = txt

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

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

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