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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

b.t = c
b.w = c
b.u = h
i.y = c
n.p = c
n.o = b
n.v = e
n.x = i
h.u = b
h.r = e
e.p = i
e.r = i
e.o = h
a.p = c
a.o = b
a.v = e
a.x = i
c.y = i
m.p = c
m.o = b
m.v = e
m.x = i
assert h.u.u.r.r.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: D = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.txt = txt

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

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

b.t = c
b.w = c
b.u = h
i.y = c
n.p = c
n.o = b
n.v = e
n.x = i
h.u = b
h.r = e
e.p = i
e.r = i
e.o = h
a.p = c
a.o = b
a.v = e
a.x = i
c.y = i
m.p = c
m.o = b
m.v = e
m.x = i
assert h.u.u.r.r.y.y.y.txt == "c"