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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

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

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