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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.p: H = None
        self.v: G = None
        self.o: C = None
        self.t: A = None
        self.s: E = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: H = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: B = None
        self.t: D = None
        self.p: B = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

n = A("n")
e = B("e")
c = C("c")
l = D("l")
f = E("f")
d = F("d")
m = G("m")
i = H("i")
j = E("j")

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.p: H = None
        self.v: G = None
        self.o: C = None
        self.t: A = None
        self.s: E = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: H = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: B = None
        self.t: D = None
        self.p: B = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

n = A("n")
e = B("e")
c = C("c")
l = D("l")
f = E("f")
d = F("d")
m = G("m")
i = H("i")
j = E("j")

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