class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.o: E = None
        self.s: I = None
        self.r: E = None
        self.x: C = None
        self.p: H = None
        self.q: H = None
        self.y: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: I = None
        self.r: A = None
        self.p: G = None
        self.x: D = None
        self.y: I = None
        self.s: I = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: B = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: C = None
        self.v: C = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: E = None
        self.w: D = None
        self.t: B = None
        self.y: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: I = None
        self.r: A = None
        self.p: G = None
        self.x: D = None
        self.y: I = None
        self.s: I = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: B = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: C = None
        self.v: C = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: E = None
        self.w: D = None
        self.t: B = None
        self.y: D = None
        self.r: H = None
        self.txt = txt

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

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