class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.y: C = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

b.u = m
b.p = m
b.y = m
b.t = e
g.v = n
g.p = c
g.t = m
g.y = k
d.u = e
d.x = h
d.q = h
e.p = i
e.y = h
i.w = d
i.o = g
i.v = e
h.w = m
h.o = g
h.v = e
n.u = d
n.p = d
n.y = d
n.t = e
c.v = n
c.p = g
c.t = d
c.y = i
m.u = e
m.x = h
m.q = i
k.w = m
k.o = c
k.v = e
assert b.t.p.w.u.y.txt == "h"