class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.o: C = None
        self.p: G = None
        self.q: D = None
        self.v: G = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.u: A = None
        self.s: A = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.u: A = None
        self.s: A = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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