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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.t: C = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.t: C = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

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