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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: I = None
        self.p: E = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.y: A = None
        self.t: A = None
        self.v: C = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

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

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

c.q = e
c.o = b
i.y = c
i.x = e
g.p = i
e.u = l
h.y = l
h.q = c
h.x = i
h.t = i
h.r = e
h.s = b
h.v = b
h.p = k
m.v = b
m.u = k
m.p = h
m.x = d
d.p = b
d.o = k
b.z = h
b.u = e
b.y = c
b.t = c
b.v = g
b.w = i
b.p = d
k.y = g
k.z = g
l.y = g
l.z = g
assert c.o.v.p.y.o.z.y.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: I = None
        self.p: E = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.y: A = None
        self.t: A = None
        self.v: C = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

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

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

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