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

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

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

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

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

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

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

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

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

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

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

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

k.u = f
k.t = m
c.v = f
g.y = m
f.s = m
f.o = m
f.t = j
f.w = j
m.t = e
e.v = f
l.u = f
l.t = m
j.u = f
j.t = m
d.u = f
d.t = m
assert c.v.w.t.t.v.w.t.t.v.txt == "f"