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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.v: G = None
        self.z: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.z: J = None
        self.t: I = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: A = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: F = None
        self.r: A = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: G = None
        self.u: B = None
        self.q: I = None
        self.o: E = None
        self.txt = txt

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

d.q = l
j.x = f
j.v = f
j.y = l
j.z = d
j.s = a
a.q = c
a.x = f
a.z = m
a.t = g
a.r = l
l.o = h
l.s = j
l.u = d
l.r = f
e.z = d
e.x = g
c.x = f
f.z = g
f.x = d
f.t = m
h.u = g
h.t = c
h.r = d
h.o = d
h.z = j
g.t = m
g.q = m
g.x = j
m.y = a
m.r = f
m.u = j
m.q = g
m.o = e
assert d.q.s.x.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.v: G = None
        self.z: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.z: J = None
        self.t: I = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: A = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: F = None
        self.r: A = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: G = None
        self.u: B = None
        self.q: I = None
        self.o: E = None
        self.txt = txt

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

d.q = l
j.x = f
j.v = f
j.y = l
j.z = d
j.s = a
a.q = c
a.x = f
a.z = m
a.t = g
a.r = l
l.o = h
l.s = j
l.u = d
l.r = f
e.z = d
e.x = g
c.x = f
f.z = g
f.x = d
f.t = m
h.u = g
h.t = c
h.r = d
h.o = d
h.z = j
g.t = m
g.q = m
g.x = j
m.y = a
m.r = f
m.u = j
m.q = g
m.o = e
assert d.q.s.x.x.q.txt == "l"