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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
l = D("l")
i = E("i")
f = F("f")
j = G("j")
m = F("m")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
l = D("l")
i = E("i")
f = F("f")
j = G("j")
m = F("m")

n.y = k
n.o = k
n.x = l
n.q = j
n.v = f
n.p = g
n.t = i
g.z = i
k.y = n
k.v = n
k.t = j
k.w = j
l.x = k
l.v = g
i.p = k
i.q = j
i.z = n
f.t = k
f.w = k
f.v = i
f.p = i
f.o = g
f.q = j
f.s = m
j.s = l
j.y = n
j.z = k
m.t = k
m.w = k
m.v = i
m.p = i
m.o = g
m.q = j
m.s = f
assert n.p.z.q.txt == "j"