class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.y: D = None
        self.q: C = None
        self.o: E = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.q: B = None
        self.r: B = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: I = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: I = None
        self.u: I = None
        self.p: D = None
        self.r: D = None
        self.y: H = None
        self.v: B = None
        self.o: B = None
        self.z: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

a.x = i
a.v = g
a.y = f
a.q = j
a.r = j
a.o = c
a.z = n
b.v = c
b.x = c
j.z = l
j.x = c
j.o = b
f.u = k
f.o = l
f.q = b
f.r = b
f.v = a
f.w = n
c.q = j
c.w = i
c.p = f
c.y = n
n.x = c
n.w = i
n.u = i
n.p = f
n.r = f
n.y = k
n.v = b
n.o = b
n.z = g
l.q = j
l.o = g
l.u = b
l.t = c
k.u = l
k.v = a
k.t = i
i.z = n
g.u = l
g.v = a
g.t = i
assert c.q.o.v.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.y: D = None
        self.q: C = None
        self.o: E = None
        self.z: F = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.q: B = None
        self.r: B = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: I = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: I = None
        self.u: I = None
        self.p: D = None
        self.r: D = None
        self.y: H = None
        self.v: B = None
        self.o: B = None
        self.z: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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