class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.v: I = None
        self.p: A = None
        self.r: D = None
        self.w: G = None
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.w: E = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.u: E = None
        self.q: F = None
        self.v: I = None
        self.w: C = None
        self.y: E = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.s: G = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.u: A = None
        self.p: G = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.o: D = None
        self.x: B = None
        self.y: G = None
        self.r: I = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.v: I = None
        self.p: A = None
        self.r: D = None
        self.w: G = None
        self.t: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.w: E = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: B = None
        self.u: E = None
        self.q: F = None
        self.v: I = None
        self.w: C = None
        self.y: E = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.s: G = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.u: A = None
        self.p: G = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: D = None
        self.o: D = None
        self.x: B = None
        self.y: G = None
        self.r: I = None
        self.t: E = None
        self.txt = txt

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

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