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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: D = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: A = None
        self.v: D = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: D = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: A = None
        self.v: D = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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