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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: A = None
        self.u: D = None
        self.v: B = 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: A = None
        self.w: E = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.v: A = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: A = None
        self.u: D = None
        self.v: B = 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: A = None
        self.w: E = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.v: A = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

f.t = c
f.r = b
c.p = n
c.v = n
c.s = i
c.u = d
b.y = k
h.s = i
h.w = k
h.y = k
h.p = l
k.w = n
k.o = c
k.s = c
k.v = i
k.z = b
n.p = c
n.v = c
n.s = f
n.u = l
d.s = g
d.w = k
d.y = k
d.p = h
i.t = n
i.r = b
g.t = n
g.r = b
l.s = i
l.w = k
l.y = k
l.p = h
assert k.v.t.s.t.p.txt == "n"