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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.y: H = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: I = None
        self.y: C = None
        self.u: B = None
        self.z: G = None
        self.x: I = None
        self.t: I = None
        self.p: C = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.z: A = None
        self.u: A = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.t: D = None
        self.u: C = None
        self.w: I = None
        self.r: I = None
        self.y: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.y: H = None
        self.x: E = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: I = None
        self.y: C = None
        self.u: B = None
        self.z: G = None
        self.x: I = None
        self.t: I = None
        self.p: C = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.z: A = None
        self.u: A = None
        self.x: F = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.t: D = None
        self.u: C = None
        self.w: I = None
        self.r: I = None
        self.y: E = None
        self.txt = txt

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

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

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