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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: D = None
        self.r: D = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: H = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: H = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.z: B = None
        self.q: A = None
        self.p: E = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: F = None
        self.t: B = None
        self.o: B = None
        self.y: C = None
        self.s: H = None
        self.p: C = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: D = None
        self.r: D = None
        self.o: B = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: H = None
        self.q: A = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: H = None
        self.r: B = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.z: B = None
        self.q: A = None
        self.p: E = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: F = None
        self.t: B = None
        self.o: B = None
        self.y: C = None
        self.s: H = None
        self.p: C = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

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

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