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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: H = None
        self.p: G = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.p: C = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: G = None
        self.s: E = None
        self.o: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.v: I = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

f = A("f")
c = B("c")
j = C("j")
a = D("a")
h = E("h")
k = F("k")
g = G("g")
b = H("b")
e = I("e")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: G = None
        self.z: A = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: J = None
        self.v: H = None
        self.p: G = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.p: C = None
        self.q: C = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: G = None
        self.s: E = None
        self.o: D = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: A = None
        self.v: I = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

f = A("f")
c = B("c")
j = C("j")
a = D("a")
h = E("h")
k = F("k")
g = G("g")
b = H("b")
e = I("e")
m = J("m")

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