class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

n.p = b
j.o = l
j.p = c
j.q = d
j.w = n
j.z = e
e.v = i
e.w = l
d.z = l
d.x = e
d.o = e
d.r = j
d.p = j
l.p = c
i.z = d
i.u = c
i.x = l
i.r = l
i.p = m
i.o = b
a.z = l
a.x = e
a.o = e
a.r = j
a.p = j
b.p = n
m.p = b
c.z = a
c.u = i
c.x = l
c.r = l
c.p = m
c.o = m
assert c.u.z.x.w.p.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

n.p = b
j.o = l
j.p = c
j.q = d
j.w = n
j.z = e
e.v = i
e.w = l
d.z = l
d.x = e
d.o = e
d.r = j
d.p = j
l.p = c
i.z = d
i.u = c
i.x = l
i.r = l
i.p = m
i.o = b
a.z = l
a.x = e
a.o = e
a.r = j
a.p = j
b.p = n
m.p = b
c.z = a
c.u = i
c.x = l
c.r = l
c.p = m
c.o = m
assert c.u.z.x.w.p.z.o.txt == "e"