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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

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

e = A("e")
k = B("k")
n = C("n")
b = D("b")
f = E("f")
j = F("j")

e.x = k
k.y = b
k.z = b
k.w = n
k.v = f
k.x = j
n.x = f
n.z = f
n.p = k
b.t = j
b.u = k
b.y = n
f.y = e
f.s = k
f.p = j
f.u = n
j.q = n
j.s = n
j.y = e
j.p = b
j.x = b
j.t = k
assert j.x.t.q.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.p: F = None
        self.u: C = None
        self.txt = txt

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

e = A("e")
k = B("k")
n = C("n")
b = D("b")
f = E("f")
j = F("j")

e.x = k
k.y = b
k.z = b
k.w = n
k.v = f
k.x = j
n.x = f
n.z = f
n.p = k
b.t = j
b.u = k
b.y = n
f.y = e
f.s = k
f.p = j
f.u = n
j.q = n
j.s = n
j.y = e
j.p = b
j.x = b
j.t = k
assert j.x.t.q.z.y.txt == "e"