class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: D = None
        self.x: F = None
        self.q: D = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: G = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.y: G = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: G = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.r: G = None
        self.s: B = None
        self.y: G = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.w: A = None
        self.txt = txt

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

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