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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.u: G = None
        self.v: D = None
        self.s: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.v: G = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

j = A("j")
g = B("g")
i = C("i")
n = D("n")
a = E("a")
h = F("h")
d = G("d")

j.q = h
j.y = n
g.t = a
g.r = j
i.r = h
i.z = d
i.u = d
i.t = d
i.v = n
i.s = n
n.q = d
n.o = j
n.u = g
n.t = i
a.s = g
h.t = i
h.q = i
h.v = d
h.s = n
h.u = a
d.y = h
d.q = j
assert j.q.u.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.u: G = None
        self.v: D = None
        self.s: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.v: G = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

j = A("j")
g = B("g")
i = C("i")
n = D("n")
a = E("a")
h = F("h")
d = G("d")

j.q = h
j.y = n
g.t = a
g.r = j
i.r = h
i.z = d
i.u = d
i.t = d
i.v = n
i.s = n
n.q = d
n.o = j
n.u = g
n.t = i
a.s = g
h.t = i
h.q = i
h.v = d
h.s = n
h.u = a
d.y = h
d.q = j
assert j.q.u.s.t.s.txt == "g"