class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.w: F = None
        self.y: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

k = A("k")
j = B("j")
n = C("n")
c = D("c")
m = E("m")
e = F("e")
i = G("i")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

k = A("k")
j = B("j")
n = C("n")
c = D("c")
m = E("m")
e = F("e")
i = G("i")

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