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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
k = C("k")
i = D("i")
d = E("d")
c = F("c")
m = B("m")
g = D("g")
j = E("j")
f = E("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.u: F = None
        self.y: A = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
k = C("k")
i = D("i")
d = E("d")
c = F("c")
m = B("m")
g = D("g")
j = E("j")
f = E("f")

n.z = k
n.q = f
n.s = i
h.o = n
h.z = k
h.t = k
h.r = d
h.y = c
k.v = c
k.o = f
k.s = n
i.o = g
i.q = k
i.u = c
i.y = n
d.q = k
d.o = k
d.x = c
c.z = n
c.p = k
m.o = n
m.z = k
m.t = k
m.r = f
m.y = c
g.o = i
g.q = k
g.u = c
g.y = n
j.q = k
j.o = k
j.x = c
f.q = k
f.o = k
f.x = c
assert j.x.z.s.y.s.y.q.o.v.z.txt == "n"