class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: G = None
        self.z: G = None
        self.o: I = None
        self.q: B = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: G = None
        self.z: G = None
        self.o: I = None
        self.q: B = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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