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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.s: B = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.u: E = None
        self.r: D = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.p: I = None
        self.v: H = None
        self.s: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.s: B = None
        self.u: E = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.u: E = None
        self.r: D = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.p: I = None
        self.v: H = None
        self.s: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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