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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: A = None
        self.w: E = None
        self.x: F = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: A = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: A = None
        self.w: E = None
        self.x: F = None
        self.r: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: A = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

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

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