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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.u: D = None
        self.p: G = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.w: D = None
        self.y: B = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

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

f = A("f")
l = B("l")
m = C("m")
a = D("a")
k = E("k")
b = F("b")
c = G("c")
j = D("j")
n = G("n")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.u: D = None
        self.p: G = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.w: D = None
        self.y: B = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

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

f = A("f")
l = B("l")
m = C("m")
a = D("a")
k = E("k")
b = F("b")
c = G("c")
j = D("j")
n = G("n")

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