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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

i.t = d
i.v = m
i.q = m
a.u = l
a.o = e
d.o = m
d.x = a
d.v = l
d.y = i
m.s = a
l.v = d
l.u = e
e.q = i
e.y = d
e.s = d
assert a.o.s.v.v.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: D = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

i.t = d
i.v = m
i.q = m
a.u = l
a.o = e
d.o = m
d.x = a
d.v = l
d.y = i
m.s = a
l.v = d
l.u = e
e.q = i
e.y = d
e.s = d
assert a.o.s.v.v.x.u.txt == "l"