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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.t: F = None
        self.w: B = None
        self.x: H = None
        self.q: E = None
        self.z: I = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: G = None
        self.w: F = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.p: H = None
        self.w: I = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: E = None
        self.t: F = None
        self.w: B = None
        self.x: H = None
        self.q: E = None
        self.z: I = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: G = None
        self.w: F = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.p: H = None
        self.w: I = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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