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

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

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

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

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

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

a.w = j
a.y = h
f.t = k
n.q = a
n.z = c
k.t = h
k.v = d
c.y = a
d.y = h
e.w = f
e.y = h
h.w = f
h.y = a
j.t = k
b.q = h
b.z = d
assert h.y.y.w.t.t.y.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

a.w = j
a.y = h
f.t = k
n.q = a
n.z = c
k.t = h
k.v = d
c.y = a
d.y = h
e.w = f
e.y = h
h.w = f
h.y = a
j.t = k
b.q = h
b.z = d
assert h.y.y.w.t.t.y.w.t.txt == "k"