class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.v: A = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.z: B = None
        self.u: G = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

a.q = k
a.w = n
a.x = n
a.v = i
a.u = l
n.o = k
n.s = i
k.t = e
k.q = e
k.o = e
k.y = i
l.q = e
h.u = k
h.q = k
c.v = e
c.u = e
c.t = e
c.w = l
c.o = l
c.z = n
e.t = k
i.q = k
i.w = n
i.x = n
i.v = a
i.u = l
assert l.q.t.y.x.o.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: B = None
        self.v: A = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.z: B = None
        self.u: G = None
        self.t: G = None
        self.o: D = None
        self.txt = txt

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

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

a.q = k
a.w = n
a.x = n
a.v = i
a.u = l
n.o = k
n.s = i
k.t = e
k.q = e
k.o = e
k.y = i
l.q = e
h.u = k
h.q = k
c.v = e
c.u = e
c.t = e
c.w = l
c.o = l
c.z = n
e.t = k
i.q = k
i.w = n
i.x = n
i.v = a
i.u = l
assert l.q.t.y.x.o.q.t.txt == "k"