class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

j.s = d
j.q = h
j.z = e
j.y = i
a.u = j
a.w = h
a.t = b
a.z = e
a.q = d
a.r = d
e.s = h
e.w = h
e.t = a
e.v = j
e.o = j
h.y = b
h.p = b
h.w = i
h.q = d
d.w = h
d.v = i
b.r = i
i.p = j
i.v = h
i.z = a
assert j.q.q.v.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: D = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

j.s = d
j.q = h
j.z = e
j.y = i
a.u = j
a.w = h
a.t = b
a.z = e
a.q = d
a.r = d
e.s = h
e.w = h
e.t = a
e.v = j
e.o = j
h.y = b
h.p = b
h.w = i
h.q = d
d.w = h
d.v = i
b.r = i
i.p = j
i.v = h
i.z = a
assert j.q.q.v.z.q.txt == "d"