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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.x: G = None
        self.t: C = None
        self.q: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.w: C = None
        self.u: G = None
        self.txt = txt

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

e = A("e")
a = B("a")
b = C("b")
j = D("j")
k = E("k")
i = F("i")
m = G("m")
l = A("l")
n = A("n")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.x: G = None
        self.t: C = None
        self.q: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: G = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.w: C = None
        self.u: G = None
        self.txt = txt

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

e = A("e")
a = B("a")
b = C("b")
j = D("j")
k = E("k")
i = F("i")
m = G("m")
l = A("l")
n = A("n")

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