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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.z: G = None
        self.v: H = None
        self.w: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.r: D = None
        self.s: A = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: J = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: B = None
        self.r: G = None
        self.s: B = None
        self.w: F = None
        self.txt = txt

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

l.w = m
l.q = m
l.z = i
l.v = i
l.o = c
l.x = c
l.t = c
l.s = a
l.r = a
m.t = d
m.q = l
m.z = i
m.v = e
m.w = c
j.y = e
a.v = c
a.o = g
a.r = j
d.v = g
d.u = m
d.r = a
d.s = l
d.y = l
d.t = j
g.s = e
i.z = m
i.w = j
e.t = g
e.w = c
c.w = d
c.v = f
c.o = l
c.q = l
f.x = a
f.u = m
f.s = m
f.r = i
f.w = g
assert f.s.w.w.r.o.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: G = None
        self.o: I = None
        self.x: I = None
        self.s: D = None
        self.r: D = None
        self.q: B = None
        self.v: G = None
        self.t: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.z: G = None
        self.v: H = None
        self.w: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.r: D = None
        self.s: A = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: J = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: B = None
        self.r: G = None
        self.s: B = None
        self.w: F = None
        self.txt = txt

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

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