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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.x: C = None
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

g = A("g")
k = B("k")
f = C("f")
c = D("c")
l = E("l")
m = B("m")
n = D("n")
b = A("b")
a = D("a")

g.p = m
k.v = b
k.z = a
k.w = g
f.t = b
c.u = n
c.s = g
c.x = f
c.p = f
c.t = f
l.v = g
m.v = b
m.z = n
m.w = g
n.u = c
n.s = g
n.x = f
n.p = f
n.t = f
b.p = k
a.u = c
a.s = b
a.x = f
a.p = f
a.t = f
assert c.u.t.t.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: A = None
        self.x: C = None
        self.p: C = None
        self.t: C = None
        self.txt = txt

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

g = A("g")
k = B("k")
f = C("f")
c = D("c")
l = E("l")
m = B("m")
n = D("n")
b = A("b")
a = D("a")

g.p = m
k.v = b
k.z = a
k.w = g
f.t = b
c.u = n
c.s = g
c.x = f
c.p = f
c.t = f
l.v = g
m.v = b
m.z = n
m.w = g
n.u = c
n.s = g
n.x = f
n.p = f
n.t = f
b.p = k
a.u = c
a.s = b
a.x = f
a.p = f
a.t = f
assert c.u.t.t.p.z.txt == "a"