class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: D = None
        self.v: B = None
        self.r: A = None
        self.o: A = None
        self.y: J = None
        self.s: A = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.w: B = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

a = A("a")
b = B("b")
l = C("l")
d = D("d")
f = E("f")
h = F("h")
j = G("j")
k = H("k")
n = I("n")
g = J("g")

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: D = None
        self.v: B = None
        self.r: A = None
        self.o: A = None
        self.y: J = None
        self.s: A = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.w: B = None
        self.p: A = None
        self.r: B = None
        self.txt = txt

a = A("a")
b = B("b")
l = C("l")
d = D("d")
f = E("f")
h = F("h")
j = G("j")
k = H("k")
n = I("n")
g = J("g")

a.v = f
a.o = b
b.q = a
b.u = d
b.v = n
b.o = k
l.w = f
l.t = n
d.x = l
d.w = j
d.q = n
d.p = h
d.u = f
d.o = g
f.s = h
f.y = k
f.o = b
h.q = j
h.w = d
h.v = b
h.r = a
h.o = a
h.s = a
h.y = g
h.t = f
h.u = l
j.p = f
j.v = d
k.x = b
n.v = j
n.w = b
n.p = a
g.x = j
g.q = k
g.w = b
g.r = b
g.p = a
assert f.y.x.u.p.u.t.v.v.o.txt == "g"