class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.v: B = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.v: B = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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