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

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

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

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

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

f = A("f")
k = B("k")
e = C("e")
j = D("j")
b = E("b")
h = C("h")
a = D("a")
g = E("g")

f.u = g
k.p = b
e.s = j
e.u = b
j.w = k
j.p = a
j.t = b
b.t = a
b.y = g
h.s = j
h.u = b
a.w = k
a.p = j
a.t = g
g.t = j
g.y = b
assert h.u.t.t.t.t.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
e = C("e")
j = D("j")
b = E("b")
h = C("h")
a = D("a")
g = E("g")

f.u = g
k.p = b
e.s = j
e.u = b
j.w = k
j.p = a
j.t = b
b.t = a
b.y = g
h.s = j
h.u = b
a.w = k
a.p = j
a.t = g
g.t = j
g.y = b
assert h.u.t.t.t.t.y.y.t.txt == "a"