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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.p: E = None
        self.z: E = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: C = None
        self.p: E = None
        self.z: E = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

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

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