class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.u: F = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

e.w = i
e.v = i
e.x = h
m.u = h
m.w = h
m.y = k
m.x = i
i.t = d
i.p = d
i.u = k
i.v = h
d.v = m
g.z = e
k.z = h
k.x = h
k.o = g
k.s = i
k.u = m
h.z = d
assert d.v.y.o.z.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: G = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.u: F = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

e.w = i
e.v = i
e.x = h
m.u = h
m.w = h
m.y = k
m.x = i
i.t = d
i.p = d
i.u = k
i.v = h
d.v = m
g.z = e
k.z = h
k.x = h
k.o = g
k.s = i
k.u = m
h.z = d
assert d.v.y.o.z.x.z.txt == "d"