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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: D = None
        self.x: G = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: C = None
        self.z: G = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: D = None
        self.x: G = None
        self.u: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: C = None
        self.z: G = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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