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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: J = None
        self.t: H = None
        self.x: F = None
        self.z: A = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.o: H = None
        self.s: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.p: H = None
        self.v: B = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.s: H = None
        self.o: E = None
        self.x: D = None
        self.t: H = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: J = None
        self.t: H = None
        self.x: F = None
        self.z: A = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.o: H = None
        self.s: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.p: H = None
        self.v: B = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.s: H = None
        self.o: E = None
        self.x: D = None
        self.t: H = None
        self.w: A = None
        self.txt = txt

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

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