class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: E = None
        self.r: I = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: H = None
        self.y: G = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: H = None
        self.x: D = None
        self.t: F = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: E = None
        self.v: C = None
        self.u: A = None
        self.p: G = None
        self.x: H = None
        self.y: E = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: B = None
        self.u: I = None
        self.z: I = None
        self.y: E = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: H = None
        self.y: G = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: H = None
        self.x: D = None
        self.t: F = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: E = None
        self.v: C = None
        self.u: A = None
        self.p: G = None
        self.x: H = None
        self.y: E = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: B = None
        self.u: I = None
        self.z: I = None
        self.y: E = None
        self.v: B = None
        self.x: B = None
        self.txt = txt

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

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

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