class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.r: G = None
        self.u: C = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: E = None
        self.p: E = None
        self.v: F = None
        self.q: A = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: E = None
        self.p: E = None
        self.v: F = None
        self.q: A = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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