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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: J = None
        self.s: D = None
        self.z: A = None
        self.v: H = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.z: J = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: J = None
        self.s: D = None
        self.z: A = None
        self.v: H = None
        self.w: I = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.z: J = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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