class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: D = None
        self.r: F = None
        self.q: G = None
        self.o: I = None
        self.v: C = None
        self.y: I = None
        self.p: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.r: F = None
        self.v: H = None
        self.x: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: G = None
        self.v: E = None
        self.q: B = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: B = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.r: F = None
        self.v: H = None
        self.x: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: G = None
        self.v: E = None
        self.q: B = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.u: B = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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