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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.r: D = None
        self.w: A = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

e = A("e")
c = B("c")
n = C("n")
j = D("j")
h = E("h")
b = F("b")
m = B("m")
l = A("l")
g = F("g")
d = F("d")

e.q = l
e.s = n
e.z = n
c.p = m
c.s = m
c.x = l
c.z = n
n.p = j
n.r = j
n.v = j
n.u = h
n.w = l
j.t = b
j.r = b
j.o = h
j.z = c
h.t = m
h.r = n
b.r = l
b.w = c
b.o = n
m.p = c
m.s = c
m.x = e
m.z = n
l.q = e
l.s = n
l.z = n
g.r = e
g.w = m
g.o = n
d.r = l
d.w = c
d.o = n
assert g.o.p.z.s.x.q.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.r: D = None
        self.w: A = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

e = A("e")
c = B("c")
n = C("n")
j = D("j")
h = E("h")
b = F("b")
m = B("m")
l = A("l")
g = F("g")
d = F("d")

e.q = l
e.s = n
e.z = n
c.p = m
c.s = m
c.x = l
c.z = n
n.p = j
n.r = j
n.v = j
n.u = h
n.w = l
j.t = b
j.r = b
j.o = h
j.z = c
h.t = m
h.r = n
b.r = l
b.w = c
b.o = n
m.p = c
m.s = c
m.x = e
m.z = n
l.q = e
l.s = n
l.z = n
g.r = e
g.w = m
g.o = n
d.r = l
d.w = c
d.o = n
assert g.o.p.z.s.x.q.q.s.txt == "n"