class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

m.u = d
j.y = m
j.v = k
j.o = d
j.z = l
j.t = c
b.s = l
d.s = j
d.t = a
l.v = c
l.z = a
l.q = m
l.w = d
k.r = a
f.r = b
c.y = m
c.v = f
c.o = d
c.z = l
c.t = j
a.s = l
assert j.v.r.s.w.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

m.u = d
j.y = m
j.v = k
j.o = d
j.z = l
j.t = c
b.s = l
d.s = j
d.t = a
l.v = c
l.z = a
l.q = m
l.w = d
k.r = a
f.r = b
c.y = m
c.v = f
c.o = d
c.z = l
c.t = j
a.s = l
assert j.v.r.s.w.t.s.txt == "l"