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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

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

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

c.v = k
c.o = d
g.t = a
g.x = a
g.s = b
g.v = d
k.t = c
k.y = d
k.z = a
d.p = k
d.t = b
d.o = b
d.s = a
n.p = d
n.w = b
n.o = e
b.p = d
b.w = n
b.o = l
e.v = k
e.o = d
l.v = f
l.o = d
a.t = g
a.x = g
a.s = b
a.v = d
f.t = e
f.y = d
f.z = a
assert a.s.o.o.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.o: E = None
        self.s: B = None
        self.txt = txt

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

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

c.v = k
c.o = d
g.t = a
g.x = a
g.s = b
g.v = d
k.t = c
k.y = d
k.z = a
d.p = k
d.t = b
d.o = b
d.s = a
n.p = d
n.w = b
n.o = e
b.p = d
b.w = n
b.o = l
e.v = k
e.o = d
l.v = f
l.o = d
a.t = g
a.x = g
a.s = b
a.v = d
f.t = e
f.y = d
f.z = a
assert a.s.o.o.p.t.txt == "c"