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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: F = None
        self.p: F = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.p: C = None
        self.y: D = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: F = None
        self.p: F = None
        self.x: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: A = None
        self.p: C = None
        self.y: D = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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