class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.r: D = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

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

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

k.v = n
k.q = d
k.r = d
k.y = g
f.z = n
f.q = k
h.s = k
d.y = c
d.r = g
d.t = g
d.w = m
g.q = c
g.x = h
g.v = d
g.y = m
n.z = f
n.q = a
m.y = c
m.r = g
m.t = g
m.w = d
i.s = a
a.v = n
a.q = m
a.r = c
a.y = g
c.y = d
c.r = g
c.t = g
c.w = m
assert c.w.w.w.t.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.r: D = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.t: E = None
        self.w: D = None
        self.txt = txt

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

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

k.v = n
k.q = d
k.r = d
k.y = g
f.z = n
f.q = k
h.s = k
d.y = c
d.r = g
d.t = g
d.w = m
g.q = c
g.x = h
g.v = d
g.y = m
n.z = f
n.q = a
m.y = c
m.r = g
m.t = g
m.w = d
i.s = a
a.v = n
a.q = m
a.r = c
a.y = g
c.y = d
c.r = g
c.t = g
c.w = m
assert c.w.w.w.t.x.s.txt == "k"