class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.o: J = None
        self.w: D = None
        self.x: F = None
        self.z: H = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: I = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.txt = txt

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

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

l.q = c
l.s = i
l.o = m
l.w = a
l.x = b
l.z = f
l.y = k
c.p = k
c.s = b
c.u = m
k.y = b
k.s = i
k.q = f
k.x = a
a.r = f
d.s = c
b.q = a
b.y = e
b.s = l
e.p = k
e.x = d
e.v = d
e.w = f
f.q = b
f.u = b
f.r = c
i.z = a
i.q = c
m.r = k
m.u = l
m.x = f
m.w = b
assert i.q.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.o: J = None
        self.w: D = None
        self.x: F = None
        self.z: H = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: I = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.txt = txt

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

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

l.q = c
l.s = i
l.o = m
l.w = a
l.x = b
l.z = f
l.y = k
c.p = k
c.s = b
c.u = m
k.y = b
k.s = i
k.q = f
k.x = a
a.r = f
d.s = c
b.q = a
b.y = e
b.s = l
e.p = k
e.x = d
e.v = d
e.w = f
f.q = b
f.u = b
f.r = c
i.z = a
i.q = c
m.r = k
m.u = l
m.x = f
m.w = b
assert i.q.u.w.txt == "b"