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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: I = None
        self.x: I = None
        self.q: H = None
        self.s: C = None
        self.o: I = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.s: G = None
        self.p: G = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.o: H = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: I = None
        self.x: I = None
        self.q: H = None
        self.s: C = None
        self.o: I = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.s: G = None
        self.p: G = None
        self.v: A = None
        self.txt = txt

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

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