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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: D = None
        self.q: D = None
        self.t: D = None
        self.w: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.z: A = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: D = None
        self.q: D = None
        self.t: D = None
        self.w: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: B = None
        self.z: A = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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