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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: B = None
        self.z: E = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

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

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

b.u = n
b.z = f
c.s = l
a.u = c
a.z = c
a.y = f
a.v = n
f.u = n
f.z = n
f.x = c
f.p = a
f.t = i
n.y = f
n.r = f
l.u = n
l.z = h
i.s = l
h.u = n
h.z = n
h.x = i
h.t = i
h.p = a
assert i.s.z.z.y.t.s.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: B = None
        self.z: E = None
        self.p: C = None
        self.t: B = None
        self.txt = txt

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

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

b.u = n
b.z = f
c.s = l
a.u = c
a.z = c
a.y = f
a.v = n
f.u = n
f.z = n
f.x = c
f.p = a
f.t = i
n.y = f
n.r = f
l.u = n
l.z = h
i.s = l
h.u = n
h.z = n
h.x = i
h.t = i
h.p = a
assert i.s.z.z.y.t.s.z.p.txt == "a"