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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.x: D = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

n = A("n")
i = B("i")
j = C("j")
d = D("d")
l = E("l")
g = F("g")
a = G("a")
e = H("e")
f = B("f")

n.q = g
n.x = a
n.t = a
n.y = j
i.y = l
i.o = l
i.t = a
i.u = f
i.p = e
i.s = e
i.r = g
j.q = l
d.x = e
l.t = g
l.p = n
l.x = d
l.q = i
l.z = i
g.u = i
a.z = l
e.o = a
f.y = l
f.o = l
f.t = a
f.u = i
f.p = e
f.s = e
f.r = g
assert g.u.u.p.o.z.q.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.t: G = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.x: D = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

n = A("n")
i = B("i")
j = C("j")
d = D("d")
l = E("l")
g = F("g")
a = G("a")
e = H("e")
f = B("f")

n.q = g
n.x = a
n.t = a
n.y = j
i.y = l
i.o = l
i.t = a
i.u = f
i.p = e
i.s = e
i.r = g
j.q = l
d.x = e
l.t = g
l.p = n
l.x = d
l.q = i
l.z = i
g.u = i
a.z = l
e.o = a
f.y = l
f.o = l
f.t = a
f.u = i
f.p = e
f.s = e
f.r = g
assert g.u.u.p.o.z.q.u.p.txt == "e"