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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.t: A = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: F = None
        self.t: A = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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