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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: A = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

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

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

n.t = d
j.t = h
j.u = l
j.x = b
j.w = d
c.u = d
c.x = n
c.p = b
c.s = b
b.s = j
b.p = j
b.q = d
g.y = l
g.v = h
g.p = c
k.y = n
k.v = g
k.p = c
h.y = n
h.v = k
h.p = c
e.t = k
e.u = n
e.x = b
e.w = j
d.t = h
d.u = l
d.x = b
d.w = j
l.t = e
assert d.x.p.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: A = None
        self.p: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

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

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

n.t = d
j.t = h
j.u = l
j.x = b
j.w = d
c.u = d
c.x = n
c.p = b
c.s = b
b.s = j
b.p = j
b.q = d
g.y = l
g.v = h
g.p = c
k.y = n
k.v = g
k.p = c
h.y = n
h.v = k
h.p = c
e.t = k
e.u = n
e.x = b
e.w = j
d.t = h
d.u = l
d.x = b
d.w = j
l.t = e
assert d.x.p.t.p.u.txt == "d"