class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

m = A("m")
b = B("b")
c = C("c")
h = D("h")
g = E("g")
l = F("l")
i = C("i")
a = E("a")

m.p = b
m.o = b
m.w = a
b.r = m
b.w = l
b.p = c
c.z = h
c.o = b
c.w = l
c.p = l
c.y = a
h.x = m
h.o = m
g.t = h
g.u = h
g.o = c
g.x = m
g.z = b
g.p = l
l.y = m
l.t = m
l.u = a
i.z = h
i.o = b
i.w = l
i.p = l
i.y = g
a.t = h
a.u = h
a.o = c
a.x = m
a.z = b
a.p = l
assert a.z.p.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

m = A("m")
b = B("b")
c = C("c")
h = D("h")
g = E("g")
l = F("l")
i = C("i")
a = E("a")

m.p = b
m.o = b
m.w = a
b.r = m
b.w = l
b.p = c
c.z = h
c.o = b
c.w = l
c.p = l
c.y = a
h.x = m
h.o = m
g.t = h
g.u = h
g.o = c
g.x = m
g.z = b
g.p = l
l.y = m
l.t = m
l.u = a
i.z = h
i.o = b
i.w = l
i.p = l
i.y = g
a.t = h
a.u = h
a.o = c
a.x = m
a.z = b
a.p = l
assert a.z.p.w.u.txt == "a"