class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: J = None
        self.x: C = None
        self.o: C = None
        self.v: A = None
        self.s: J = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.w: D = None
        self.x: E = None
        self.z: E = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: H = None
        self.y: E = None
        self.z: J = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: J = None
        self.x: C = None
        self.o: C = None
        self.v: A = None
        self.s: J = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: C = None
        self.w: D = None
        self.x: E = None
        self.z: E = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: H = None
        self.y: E = None
        self.z: J = None
        self.txt = txt

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

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

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