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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: F = None
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

a.x = e
a.w = g
a.y = d
a.o = i
g.z = e
g.u = h
g.y = i
d.z = i
d.u = i
d.x = g
h.y = i
l.w = g
i.o = d
e.q = d
e.z = l
e.w = h
e.x = h
assert h.y.o.u.o.x.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: B = None
        self.y: C = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: F = None
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

a.x = e
a.w = g
a.y = d
a.o = i
g.z = e
g.u = h
g.y = i
d.z = i
d.u = i
d.x = g
h.y = i
l.w = g
i.o = d
e.q = d
e.z = l
e.w = h
e.x = h
assert h.y.o.u.o.x.y.o.txt == "d"