class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: B = None
        self.u: B = None
        self.t: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

i = A("i")
b = B("b")
e = C("e")
a = D("a")
n = E("n")
l = F("l")
g = G("g")
d = H("d")
j = F("j")

i.w = d
i.t = a
b.x = j
b.t = d
b.q = d
b.v = l
e.o = b
e.v = b
e.y = n
e.q = a
a.y = d
a.q = b
a.u = b
a.t = g
a.p = j
n.z = d
n.o = d
l.t = g
g.s = e
g.q = d
d.z = g
j.t = g
assert g.q.z.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: B = None
        self.u: B = None
        self.t: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

i = A("i")
b = B("b")
e = C("e")
a = D("a")
n = E("n")
l = F("l")
g = G("g")
d = H("d")
j = F("j")

i.w = d
i.t = a
b.x = j
b.t = d
b.q = d
b.v = l
e.o = b
e.v = b
e.y = n
e.q = a
a.y = d
a.q = b
a.u = b
a.t = g
a.p = j
n.z = d
n.o = d
l.t = g
g.s = e
g.q = d
d.z = g
j.t = g
assert g.q.z.q.z.txt == "g"