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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: J = None
        self.t: D = None
        self.q: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: A = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: J = None
        self.t: D = None
        self.q: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: A = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: I = None
        self.txt = txt

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

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