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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: H = None
        self.w: F = None
        self.t: J = None
        self.p: J = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.p: C = None
        self.y: G = None
        self.q: J = None
        self.x: A = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.t: H = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: H = None
        self.w: F = None
        self.t: J = None
        self.p: J = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.p: C = None
        self.y: G = None
        self.q: J = None
        self.x: A = None
        self.s: G = None
        self.t: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: G = None
        self.t: H = None
        self.q: A = None
        self.txt = txt

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

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