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

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

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

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

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

d = A("d")
e = B("e")
j = C("j")
m = D("m")
b = E("b")
l = B("l")
k = E("k")
g = B("g")
i = A("i")
n = B("n")

d.t = j
e.p = d
j.v = g
j.s = i
m.y = b
m.z = d
b.p = j
b.v = j
b.q = i
b.z = m
l.p = i
k.p = j
k.v = j
k.q = i
k.z = m
g.p = d
i.t = j
n.p = i
assert n.p.t.v.p.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

d = A("d")
e = B("e")
j = C("j")
m = D("m")
b = E("b")
l = B("l")
k = E("k")
g = B("g")
i = A("i")
n = B("n")

d.t = j
e.p = d
j.v = g
j.s = i
m.y = b
m.z = d
b.p = j
b.v = j
b.q = i
b.z = m
l.p = i
k.p = j
k.v = j
k.q = i
k.z = m
g.p = d
i.t = j
n.p = i
assert n.p.t.v.p.t.s.t.txt == "j"