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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: F = None
        self.t: H = None
        self.r: I = None
        self.s: C = None
        self.y: I = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.w: I = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: C = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.s: C = None
        self.t: H = None
        self.x: H = None
        self.v: H = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: F = None
        self.t: F = None
        self.o: I = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.y: D = None
        self.q: G = None
        self.r: A = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: F = None
        self.t: H = None
        self.r: I = None
        self.s: C = None
        self.y: I = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: B = None
        self.w: I = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: C = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.s: C = None
        self.t: H = None
        self.x: H = None
        self.v: H = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: F = None
        self.t: F = None
        self.o: I = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.y: D = None
        self.q: G = None
        self.r: A = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

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