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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.w: C = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.o: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.w: C = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.o: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

a.t = k
a.y = k
a.z = e
a.q = e
n.p = e
n.y = e
n.r = k
n.t = k
j.t = i
j.w = i
j.u = a
b.q = f
b.p = f
b.w = j
b.v = n
b.o = k
f.y = k
k.u = e
k.q = e
e.x = k
e.q = f
e.o = b
e.u = b
e.z = a
i.t = j
i.w = j
i.u = a
assert j.u.q.x.q.txt == "e"