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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

f.p = h
n.t = i
n.s = i
n.x = h
n.u = l
n.q = l
h.z = i
h.w = i
h.x = f
h.t = j
i.u = j
m.y = a
l.t = j
l.s = i
l.x = e
l.u = n
l.q = n
e.z = i
e.w = i
e.t = i
e.x = f
j.u = i
b.y = e
a.z = i
a.w = i
a.x = f
a.t = j
assert m.y.t.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

f.p = h
n.t = i
n.s = i
n.x = h
n.u = l
n.q = l
h.z = i
h.w = i
h.x = f
h.t = j
i.u = j
m.y = a
l.t = j
l.s = i
l.x = e
l.u = n
l.q = n
e.z = i
e.w = i
e.t = i
e.x = f
j.u = i
b.y = e
a.z = i
a.w = i
a.x = f
a.t = j
assert m.y.t.u.u.u.u.u.u.txt == "j"