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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

a.r = b
a.q = e
a.u = d
c.o = d
c.z = n
j.s = d
j.w = a
j.x = l
j.q = f
l.t = j
b.w = c
b.s = a
b.q = n
b.p = d
d.s = j
e.s = d
e.w = a
e.x = l
e.q = f
n.o = d
n.z = c
f.s = d
f.w = a
f.x = l
f.q = e
assert d.s.w.u.s.x.t.x.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

a.r = b
a.q = e
a.u = d
c.o = d
c.z = n
j.s = d
j.w = a
j.x = l
j.q = f
l.t = j
b.w = c
b.s = a
b.q = n
b.p = d
d.s = j
e.s = d
e.w = a
e.x = l
e.q = f
n.o = d
n.z = c
f.s = d
f.w = a
f.x = l
f.q = e
assert d.s.w.u.s.x.t.x.t.w.txt == "a"