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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: H = None
        self.u: E = None
        self.v: C = None
        self.p: E = None
        self.o: C = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.v: C = None
        self.p: C = None
        self.z: G = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: H = None
        self.u: E = None
        self.v: C = None
        self.p: E = None
        self.o: C = None
        self.w: E = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.v: C = None
        self.p: C = None
        self.z: G = None
        self.u: F = None
        self.txt = txt

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

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