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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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