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

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

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

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

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

d = A("d")
h = B("h")
k = C("k")
m = D("m")
f = E("f")
l = D("l")
j = C("j")
b = D("b")
e = E("e")

d.w = e
d.s = l
d.z = l
h.v = k
h.z = m
h.w = j
h.y = e
k.u = j
m.y = d
f.s = k
f.z = k
l.y = d
j.u = k
b.y = d
e.s = k
e.z = j
assert h.y.z.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
k = C("k")
m = D("m")
f = E("f")
l = D("l")
j = C("j")
b = D("b")
e = E("e")

d.w = e
d.s = l
d.z = l
h.v = k
h.z = m
h.w = j
h.y = e
k.u = j
m.y = d
f.s = k
f.z = k
l.y = d
j.u = k
b.y = d
e.s = k
e.z = j
assert h.y.z.u.u.u.u.u.u.u.txt == "k"