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

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

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

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

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

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

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

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

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

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

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

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

a.u = i
a.s = f
a.z = l
a.x = l
c.y = j
c.w = i
h.t = f
i.s = j
i.t = k
j.z = n
b.u = n
b.s = f
b.z = c
b.x = c
n.s = j
n.t = a
l.y = j
l.w = i
k.u = n
k.s = h
k.z = l
k.x = c
f.t = h
assert l.y.z.t.s.t.t.t.t.t.t.txt == "f"