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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: D = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: D = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.o: E = None
        self.txt = txt

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

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

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