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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: E = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: E = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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