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

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

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

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

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

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

k.u = c
b.o = g
c.w = h
c.p = f
j.v = i
j.t = b
e.s = c
n.s = c
h.s = f
g.u = c
f.w = h
f.p = c
i.w = h
i.p = f
assert k.u.w.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

k.u = c
b.o = g
c.w = h
c.p = f
j.v = i
j.t = b
e.s = c
n.s = c
h.s = f
g.u = c
f.w = h
f.p = c
i.w = h
i.p = f
assert k.u.w.s.p.txt == "c"