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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.y: D = None
        self.t: E = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
b = D("b")
d = E("d")
a = F("a")
l = E("l")

i.s = m
m.v = l
g.u = m
g.s = m
b.x = m
b.z = m
b.s = m
b.v = a
d.r = a
a.o = i
a.q = d
a.t = d
a.y = b
l.r = a
assert m.v.r.o.s.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.y: D = None
        self.t: E = None
        self.txt = txt

i = A("i")
m = B("m")
g = C("g")
b = D("b")
d = E("d")
a = F("a")
l = E("l")

i.s = m
m.v = l
g.u = m
g.s = m
b.x = m
b.z = m
b.s = m
b.v = a
d.r = a
a.o = i
a.q = d
a.t = d
a.y = b
l.r = a
assert m.v.r.o.s.v.r.txt == "a"