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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

a.z = i
a.u = h
e.w = j
f.t = n
f.y = h
f.r = h
f.w = a
f.s = e
f.u = i
h.q = e
n.w = g
n.z = i
n.s = i
n.t = h
n.r = f
i.y = e
j.t = i
j.u = i
j.o = i
g.w = n
g.z = i
g.s = i
g.t = h
g.r = f
assert g.r.w.z.y.w.t.y.txt == "e"