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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.o: A = None
        self.s: I = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: H = None
        self.v: D = None
        self.p: I = None
        self.q: I = None
        self.t: A = None
        self.r: B = None
        self.y: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: D = None
        self.x: D = None
        self.z: A = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: E = None
        self.o: A = None
        self.s: I = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: H = None
        self.v: D = None
        self.p: I = None
        self.q: I = None
        self.t: A = None
        self.r: B = None
        self.y: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: D = None
        self.x: D = None
        self.z: A = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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