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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

g = A("g")
h = B("h")
i = C("i")
f = D("f")
m = E("m")
n = F("n")
d = C("d")
l = B("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

g = A("g")
h = B("h")
i = C("i")
f = D("f")
m = E("m")
n = F("n")
d = C("d")
l = B("l")

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