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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: H = None
        self.z: A = None
        self.t: A = None
        self.y: D = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: E = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.x: G = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.w: F = None
        self.x: C = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: H = None
        self.z: A = None
        self.t: A = None
        self.y: D = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: E = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.x: G = None
        self.w: E = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: F = None
        self.w: F = None
        self.x: C = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

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

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