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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: A = None
        self.u: G = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: A = None
        self.u: G = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.w: C = None
        self.x: A = None
        self.txt = txt

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

j.t = k
j.w = i
k.q = d
k.r = h
k.o = h
k.p = a
e.q = f
e.u = k
e.z = i
a.w = d
a.s = h
a.u = e
d.u = k
d.s = f
h.t = k
h.r = j
h.s = j
h.u = i
i.o = h
i.t = k
i.w = e
i.x = j
f.u = k
f.s = d
assert h.t.r.u.w.z.o.s.t.txt == "k"