class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.w: F = None
        self.o: D = None
        self.y: C = 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.u: F = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: E = None
        self.v: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.w: F = None
        self.o: D = None
        self.y: C = 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.u: F = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: E = None
        self.v: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

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

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