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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.v: D = None
        self.z: J = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: B = None
        self.t: C = None
        self.v: J = None
        self.p: D = None
        self.q: E = None
        self.z: C = None
        self.w: D = None
        self.x: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: B = None
        self.s: A = None
        self.y: G = None
        self.w: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: D = None
        self.v: D = None
        self.z: J = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: B = None
        self.t: C = None
        self.v: J = None
        self.p: D = None
        self.q: E = None
        self.z: C = None
        self.w: D = None
        self.x: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: B = None
        self.s: A = None
        self.y: G = None
        self.w: I = None
        self.txt = txt

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

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