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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: C = None
        self.y: B = None
        self.w: C = None
        self.t: C = None
        self.u: F = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
e = D("e")
m = E("m")
c = F("c")
f = C("f")
h = F("h")

n.p = m
a.x = n
a.u = m
a.p = c
j.o = m
j.y = f
j.r = a
j.u = n
j.v = e
e.p = a
e.o = c
e.w = m
e.s = m
e.z = h
m.o = a
m.y = a
m.p = a
m.u = n
c.s = h
c.u = h
c.p = f
c.w = f
c.t = f
c.y = a
f.o = m
f.y = j
f.r = a
f.u = n
f.v = e
h.s = c
h.u = c
h.p = j
h.y = a
h.w = f
h.t = f
assert e.w.u.p.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: C = None
        self.y: B = None
        self.w: C = None
        self.t: C = None
        self.u: F = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
e = D("e")
m = E("m")
c = F("c")
f = C("f")
h = F("h")

n.p = m
a.x = n
a.u = m
a.p = c
j.o = m
j.y = f
j.r = a
j.u = n
j.v = e
e.p = a
e.o = c
e.w = m
e.s = m
e.z = h
m.o = a
m.y = a
m.p = a
m.u = n
c.s = h
c.u = h
c.p = f
c.w = f
c.t = f
c.y = a
f.o = m
f.y = j
f.r = a
f.u = n
f.v = e
h.s = c
h.u = c
h.p = j
h.y = a
h.w = f
h.t = f
assert e.w.u.p.p.u.txt == "m"