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

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

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

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

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

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

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

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

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

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

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

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

e.v = c
e.r = m
e.t = g
d.s = c
d.v = g
d.r = g
d.w = k
d.q = e
m.s = l
m.y = l
l.r = d
l.p = g
l.t = k
l.s = f
g.w = l
g.q = l
g.z = l
g.o = l
k.r = a
k.p = g
k.t = l
k.s = f
c.v = e
c.r = f
c.t = g
f.s = l
f.y = l
a.s = c
a.q = c
a.v = g
a.r = g
a.w = k
assert d.s.v.t.w.txt == "l"