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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: J = None
        self.x: A = None
        self.r: B = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: B = None
        self.z: I = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: A = None
        self.w: J = None
        self.y: C = None
        self.x: C = None
        self.z: H = None
        self.q: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.w: I = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: A = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.t: E = None
        self.p: E = None
        self.o: I = None
        self.z: H = None
        self.u: G = None
        self.r: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: J = None
        self.x: A = None
        self.r: B = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.u: B = None
        self.z: I = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: A = None
        self.w: J = None
        self.y: C = None
        self.x: C = None
        self.z: H = None
        self.q: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.w: I = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: A = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.t: E = None
        self.p: E = None
        self.o: I = None
        self.z: H = None
        self.u: G = None
        self.r: I = None
        self.txt = txt

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

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