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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.txt = txt

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

e = A("e")
j = B("j")
h = C("h")
i = D("i")
b = E("b")
n = A("n")
m = A("m")

e.u = b
e.z = n
e.t = h
j.t = b
j.o = b
j.q = i
j.p = h
j.v = n
h.y = b
i.z = j
i.v = b
b.p = j
b.w = h
n.u = b
n.z = m
n.t = h
m.u = b
m.z = n
m.t = h
assert b.w.y.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: A = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.txt = txt

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

e = A("e")
j = B("j")
h = C("h")
i = D("i")
b = E("b")
n = A("n")
m = A("m")

e.u = b
e.z = n
e.t = h
j.t = b
j.o = b
j.q = i
j.p = h
j.v = n
h.y = b
i.z = j
i.v = b
b.p = j
b.w = h
n.u = b
n.z = m
n.t = h
m.u = b
m.z = n
m.t = h
assert b.w.y.p.p.txt == "h"