class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.o: G = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.v: A = None
        self.r: C = None
        self.s: G = None
        self.u: D = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: D = None
        self.w: B = None
        self.x: A = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.o: G = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: E = None
        self.v: A = None
        self.r: C = None
        self.s: G = None
        self.u: D = None
        self.p: I = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: D = None
        self.w: B = None
        self.x: A = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

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