class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.p: F = None
        self.r: D = None
        self.u: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.o: C = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

a = A("a")
j = B("j")
k = C("k")
g = D("g")
f = E("f")
m = F("m")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.o: C = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

a = A("a")
j = B("j")
k = C("k")
g = D("g")
f = E("f")
m = F("m")

a.z = f
a.u = f
a.t = k
a.p = m
a.r = g
a.x = j
j.u = a
j.s = a
k.w = f
k.v = a
g.y = k
g.q = k
f.y = j
f.x = g
f.u = m
m.x = a
m.u = k
m.o = k
m.r = k
m.v = j
assert j.s.t.w.y.s.t.txt == "k"