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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.y: D = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: G = None
        self.y: D = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.s: B = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

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