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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.o: H = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: I = None
        self.v: F = None
        self.t: F = None
        self.q: D = None
        self.x: D = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.x: B = None
        self.q: C = None
        self.o: E = None
        self.t: F = None
        self.y: F = None
        self.txt = txt

b = A("b")
l = B("l")
g = C("g")
n = D("n")
m = E("m")
d = F("d")
j = G("j")
c = H("c")
k = I("k")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.o: H = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.r: E = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: I = None
        self.v: F = None
        self.t: F = None
        self.q: D = None
        self.x: D = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: F = None
        self.x: B = None
        self.q: C = None
        self.o: E = None
        self.t: F = None
        self.y: F = None
        self.txt = txt

b = A("b")
l = B("l")
g = C("g")
n = D("n")
m = E("m")
d = F("d")
j = G("j")
c = H("c")
k = I("k")

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