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

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

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

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

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

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

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

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

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

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

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

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

k.t = a
k.v = a
k.p = a
k.q = c
n.v = d
n.t = c
n.q = g
d.z = g
d.v = b
g.w = f
g.t = a
c.u = a
c.q = d
c.t = k
e.v = d
e.t = c
e.q = g
f.z = g
f.v = d
a.t = k
a.v = k
a.p = k
a.q = c
b.z = g
b.v = j
j.z = g
j.v = f
assert k.p.q.u.t.v.txt == "a"