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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.y: C = None
        self.txt = txt

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

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

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

m = A("m")
a = B("a")
f = C("f")
g = D("g")
j = E("j")
c = C("c")
i = E("i")
l = D("l")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.y: C = None
        self.txt = txt

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

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

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

m = A("m")
a = B("a")
f = C("f")
g = D("g")
j = E("j")
c = C("c")
i = E("i")
l = D("l")

m.v = i
m.s = a
m.t = f
a.w = f
a.y = f
a.r = m
f.v = i
g.s = m
g.z = a
g.q = a
g.r = f
j.o = g
j.w = g
j.v = i
j.z = i
c.v = j
i.o = g
i.v = j
i.z = j
i.w = l
l.s = m
l.z = a
l.q = a
l.r = c
assert l.s.v.v.txt == "j"