class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: F = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: F = None
        self.w: D = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: H = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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