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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: E = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

n.z = j
n.x = a
n.u = a
n.w = g
n.q = l
n.t = k
n.y = h
l.p = n
l.w = n
l.o = a
l.y = g
j.p = n
g.q = j
g.z = j
g.p = n
g.x = a
g.w = m
g.y = l
a.o = g
a.t = l
a.q = m
k.z = h
k.x = m
k.u = l
k.y = n
m.v = k
m.w = k
m.z = g
h.p = n
assert n.y.p.y.p.z.p.q.txt == "l"