class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: G = None
        self.u: J = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: F = None
        self.z: I = None
        self.w: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: F = None
        self.z: I = None
        self.w: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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