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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: I = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.t: A = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.t: A = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: I = None
        self.p: G = None
        self.z: G = None
        self.v: A = None
        self.x: F = None
        self.r: D = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

f.v = h
c.o = l
c.r = l
c.u = m
c.x = b
h.z = k
k.v = e
k.w = l
k.z = l
k.t = f
k.q = c
e.r = m
e.t = n
e.x = k
l.u = e
l.x = e
l.t = f
l.q = m
l.v = g
g.u = e
g.z = b
g.w = m
n.t = m
n.q = m
n.p = g
n.z = g
n.v = f
n.u = f
n.x = l
n.r = b
n.w = b
m.q = c
b.v = e
b.w = l
b.z = l
b.t = f
b.q = c
assert h.z.w.q.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: I = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.t: A = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.t: A = None
        self.q: I = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: I = None
        self.p: G = None
        self.z: G = None
        self.v: A = None
        self.x: F = None
        self.r: D = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

f.v = h
c.o = l
c.r = l
c.u = m
c.x = b
h.z = k
k.v = e
k.w = l
k.z = l
k.t = f
k.q = c
e.r = m
e.t = n
e.x = k
l.u = e
l.x = e
l.t = f
l.q = m
l.v = g
g.u = e
g.z = b
g.w = m
n.t = m
n.q = m
n.p = g
n.z = g
n.v = f
n.u = f
n.x = l
n.r = b
n.w = b
m.q = c
b.v = e
b.w = l
b.z = l
b.t = f
b.q = c
assert h.z.w.q.q.u.q.txt == "c"