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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.v: F = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.v: F = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: I = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: I = None
        self.txt = txt

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

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

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