class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: G = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: B = None
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: G = None
        self.y: H = None
        self.o: C = None
        self.u: F = None
        self.z: D = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: J = None
        self.q: E = None
        self.z: H = None
        self.v: E = None
        self.u: E = None
        self.p: J = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.w: I = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: G = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: B = None
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: G = None
        self.y: H = None
        self.o: C = None
        self.u: F = None
        self.z: D = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: J = None
        self.q: E = None
        self.z: H = None
        self.v: E = None
        self.u: E = None
        self.p: J = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.w: I = None
        self.x: H = None
        self.txt = txt

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

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