class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: C = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.r: I = None
        self.v: C = None
        self.t: I = None
        self.w: A = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.t: B = None
        self.x: I = None
        self.z: B = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
i = C("i")
c = D("c")
k = E("k")
b = F("b")
f = G("f")
m = H("m")
g = I("g")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.r: I = None
        self.v: C = None
        self.t: I = None
        self.w: A = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.t: B = None
        self.x: I = None
        self.z: B = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
i = C("i")
c = D("c")
k = E("k")
b = F("b")
f = G("f")
m = H("m")
g = I("g")
n = F("n")

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